﻿@model Bids.Web.Model.DesignerModel
@using Autofac
@using Autofac.Integration.Mvc

@using Bids.Service
@{
    ViewBag.Title = "设计师大厅";
    Layout = "_Layout.cshtml";

}

@section head{
    <script type="text/javascript">
        function newsmydialog(Content) {
            var da = art.dialog({
                title: "网站新闻",
                lock: true,
                content: Content,
                ok: function () {
                    da.close();
                }
            });
        }

        function Helpsmydialog(parameters) {
            var da = art.dialog({
                title: "设计师须知",
                lock: true,
                content: parameters,
                ok: function () {
                    da.close();
                }
            });
        }

        function pinlun() {
            jQuery.post("/Designer/PinLun", { MoodId: jQuery("#myMoodId").val(), ParentId: jQuery("#myParentId").val(), UserId: jQuery("#myUserId").val(), }, function (data) {
                if (data == "ok") {
                    document.location.href = '/Designer/Index';
                }
            });
        }
        function Myblack() {
            jQuery("#myid ~ div").css("display", "block");
        }

        function fabu() {
            jQuery.post("/Designer/Moods", { UserId: jQuery("#myUserId").val(), Content: jQuery("#msgtextarea").val(), }, function (data) {
                if (data == "ok") {
                    document.location.href = '/Designer/Index';
                }
            });
        }
        //评论
        jQuery(function () {
            jQuery('.submit-my').click(function () {
                var content = jQuery(this).parent().siblings(".reply-input").val();
                var moodid = jQuery(this).parent().siblings("#myMoodId").val();
                var parentid = jQuery(this).parent().siblings("#myParentId").val();
                var userid = jQuery(this).parent().siblings("#myUserId").val();

                jQuery.post("/Designer/PinLun", { "Content": content, "MoodId": moodid, "ParentId": parentid, "UserId": userid }, function (data) {
                    location.href = "/Designer/Index";
                });
            });
            jQuery('.submit-my2').click(function () {
                var content = jQuery(this).siblings(".mycontent").val();
                var moodid = jQuery(this).siblings("#myMoodId2").val();
                var parentid = jQuery(this).siblings("#myParentId2").val();
                var userid = jQuery(this).siblings("#myUserId2").val();
                jQuery.post("/Designer/HueiFu", { "Content": content, "MoodId": moodid, "ParentId": parentid, "UserId": userid }, function (data) {
                    location.href = "/Designer/Index";
                });
            });
            jQuery(".mydiplay").click(function () {
                jQuery(this).siblings(".mydivs").css("display", "block");
            });
        });
    </script>
}




<!-- 中栏交流-start -->
<div class="mid-column">
    <div class="topic-area ">
        <div class="tell-us clearfix">
            <img class="pull-left" src="/images/tell-us.gif">
            <div class="pull-left ml1">
                还可以输入<strong id="characters_count">140</strong>字
            </div>
            @*<div id="weibo-search" class="pull-right">
                <input id="inputweibosearch" onfocus="jQuery(this).parent().addClass('focus');" onblur="if(jQuery(this).val()==''){jQuery(this).parent().removeClass('focus');}" type="text">
                <a href="#" class="search-btn" onclick="weibo_search(this);return false;">搜索</a>
                <input id="hid_keywords" value="" type="hidden">
            </div>*@
        </div>
        <div class="main-area">
            <input type="hidden" name="myUserId" id="myUserId" value="@Model.Users.ID" />
            <textarea name="msgtextarea" id="msgtextarea" cols="30" rows="10"></textarea>
            <span class="arrow"></span>
        </div>
        <div class="clearfix">
            @* <a id="showface" href="javascript:void(0)" class="pull-left icon-editor img mr1"></a>*@
            @*<div id="uploadimg" class="pull-left icon-editor upload">
                <div class="qq-uploader">
                    <div style="display: none;" class="qq-upload-drop-area"><span>Drop files here to upload</span></div>
                    <div style="position: relative; overflow: hidden; direction: ltr;" class="qq-upload-button">
                        <div></div>
                        <input style="position: absolute; right: 0px; top: 0px; font-family: Arial; margin: 0px; padding: 0px; cursor: pointer; opacity: 0;" name="file" type="file">
                    </div>
                    <ul class="qq-upload-list"></ul>
                </div>
            </div>*@
            <a id="publishmsg" class="no-text send pull-right" href="javascript:fabu()"></a>
            <div class="show_e hidden"></div>
        </div>
    </div>

    <div class="topic-content">
        <!--Announcements-->
        <style type="text/css">
            #a-n {
                border-bottom: 1px solid #ddd;
            }

            .a-div {
                margin-bottom: 5px;
                cursor: pointer;
                background: url(../images/Phone_43.gif) no-repeat left center;
                padding-left: 25px;
            }

            .a-img {
                width: 40px;
                float: left;
                display: inline;
                margin: 0 6px 0 0;
                border-radius: 4px 4px 4px 4px;
            }

            .a-info {
                width: 480px;
                float: left;
                background: #e1f5fe;
                height: 38px;
                overflow: hidden;
                padding: 2px 5px;
                position: relative;
            }

            .a-info-h {
                background: #feece8;
            }

            .a-info-s {
                background: #feece8;
            }

            #a-n-detail {
                padding-bottom: 0;
            }

            .btnq {
                background: #000;
                opacity: 0.7;
                filter: alpha(opacity=70);
                border-radius: 4px 4px 4px 4px;
                height: 20px;
                line-height: 20px;
                color: #fff;
                width: 80px;
                position: absolute;
                right: 0;
                bottom: 0;
                text-align: center;
            }
        </style>

        <script type="text/javascript">
            jQuery(function () {
                jQuery('.a-div').hover(function () {
                    jQuery('.btnq').remove();
                    jQuery(this).find('.a-info').append('<div class="btnq">查看详情&gt;&gt;</div>');
                },
                    function () {
                        jQuery('.btnq').remove();
                    });
                jQuery('.a-div').click(function () {
                    jQuery('#a-n-detail').html('<div class="loading2"></div>');
                    var str = '';
                    jQuery.ajax({
                        type: 'POST',
                        url: '../ajax.php',
                        dataType: 'json',
                        data: 'id=' + jQuery(this).attr('lang') + '&action=show_one_msg',
                        success: function (html) {
                            var count = jQuery(html.replylist).size();
                            str += '<div class="lit-avater pull-left"><a href="../designer.php?id=' + html['user_id'] + '"><img src="#' + html['face'] + '" width="50" height="50"></a></div><div class="topic-detail pull-left"><div class="topic-head clearfix"><a href="../designer.php?id=' + html['user_id'] + '" class="font16 pull-left">' + html['user_name'] + '<span class="level-img">' + html['level_img'] + '</span></a><span class="pull-right">' + html['publish_time'] + '前</span></div><div class="he-say">' + html['msg'];
                            if (html['img_path'] != '') {
                                str += '<div class="small-img" onclick="change_msg_img(this);"><div class="to-big-img"><a href="' + html['img_path'] + '" target="_blank">查看大图</a></div><img class="msg_img" src="' + html['thumb_img_path'] + '" style="max-width:150px;"></div>';
                            }
                            str += '</div><div class="reply">';
                            if (html['user_id'] == html['sess_user_id']) { //只有发布者本人能删除
                                str += '<a href="#" onclick="del_designer_msg(this,' + html['id'] + ');return false;">删除</a><span class="light-grey">&nbsp;&nbsp;|&nbsp;</span> ';
                            }
                            if (count == 0) { //如果回复数为0，那么直接不显示回复后的括号和数字
                                str += '<a href="#" onclick="show_hide_comments(this);return false;">回复<span class="replycountout hidden">(<span class="replycount red">' + count + '</span>)</span></a></div><div class="comments hidden"><span class="reply-arrow"></span><div class="reply-area clearfix"><input class="reply-input" type="text"><div class="clearfix"><a id="facepanelid' + html['id'] + '" href="JavaScript:void(0);" class="pull-left icon-editor img faceeditor"></a><a class="submit-reply pull-right" href="#" lang="' + html['id'] + '" onclick="post_reply(this);return false;">评论</a></div></div>';
                            } else { //如果有回复，那么显示后面的括号和数字，且数字用红色显示
                                str += '<a href="#" onclick="show_hide_comments(this);return false;">回复<span class="replycountout">(<span class="replycount red">' + count + '</span>)</span></a></div><div class="comments"><span class="reply-arrow"></span><div class="reply-area clearfix"><input class="reply-input" type="text"><div class="clearfix"><a id="facepanelid' + html['id'] + '" href="JavaScript:void(0);" class="pull-left icon-editor img faceeditor"></a><a class="submit-reply pull-right" href="#" lang="' + html['id'] + '" onclick="post_reply(this);return false;">评论</a></div></div>';
                            }

                            if (count > 0) {
                                for (var r = 0; r < count; r++) {
                                    if (r < 9) { //如果当前回复是前10条记录，则直接显示
                                        str += '<div class="a-comment clearfix">';
                                    } else if (r >= 9) { //如果当前回复是前10条记录，则默认隐藏
                                        str += '<div class="a-comment clearfix" style="display:none;">';
                                    }
                                    str += '<div class="pull-left mini-avater"><a href="../designer.php?id=' + html['replylist'][r]['user_id'] + '"><img src="http://www.logo123.net/' + html['replylist'][r]['face'] + '" width="30" height="30"></a></div><div class="other-say"><a href="../designer.php?id=' + html['replylist'][r]['user_id'] + '">' + html['replylist'][r]['user_name'] + '<span class="level-img">' + html['replylist'][r]['level_img'] + '</span></a>：' + html['replylist'][r]['msg'] + '&nbsp;&nbsp;<span class="light">(' + html['replylist'][r]['publish_time'] + '前)</span>';
                                    if (html['replylist'][r]['user_id'] == html['replylist'][r]['sess_user_id']) { //只有回复者本人能删除
                                        str += '<div class="text-right"><a href="#" onclick="del_designer_msg_reply(this,' + html['replylist'][r]['reply_id'] + ');return false;">删除</a></div>';
                                    }
                                    str += '</div></div>';
                                    if (r == 9) { //如果刚好循环到第10条，加入一个“更多回复...”的按钮
                                        str += '<div class="text-center pa1"><a class="btn btn-mini" href="#" onclick="show_remaining_reply(this);return false;">更多回复...</a></div>';
                                    }
                                }
                            }
                            str += '</div></div>';
                            jQuery('#a-n-detail').html(str);
                            bind_face_event();
                        },
                        failure: function () { }
                    });
                });
            });
        </script>
        <!--Announcements End-->
    </div>

    <div class="topic-content" id="t1">
        <!-- 如果搜索关键词匹配不到结果 -->



        <!-- 话题-start -->
        @foreach (var item in Model.Moods)
        {
            <div class="a-topic clearfix">
                <div class="lit-avater pull-left">
                    <a href="/Designer/DesignerMain?id=@item.User.ID">
                        <img src="@item.User.HeadPortrait" height="50" width="50"></a>
                </div>
                <div class="topic-detail pull-left">
                    <div class="topic-head clearfix">
                        <a href="/Designer/DesignerMain?id=@item.User.ID" class="font16 pull-left">@(item.User.NickName) @*<span class="level-img"><img src="/images/level_0.gif" class="img2" alt="实习设计师" title="实习设计师" align="absmiddle"></span>*@</a>

                        <span class="pull-right">
                            @((DateTime.Now - item.CreateTime).Hours > 0 ? (DateTime.Now - item.CreateTime).Hours + "小时" : null)@((DateTime.Now - item.CreateTime).Minutes)分钟前</span>
                    </div>
                    <div class="he-say">
                        @item.Content
                        @*<div class="small-img" onclick="change_msg_img(this);">
                                                        <div class="to-big-img"><a href="#" target="_blank">查看大图</a></div>
                                                        <img class="msg_img" src="/images/1369283465_thumb.gif" style="max-width: 150px;">
                                                    </div>*@
                    </div>
                    <div class="reply">
                        <a href="#" onclick="show_hide_comments(this);return false;">回复<span class="replycountout ">(<span class="replycount red">@item.MoodReplys.Count</span>)</span></a>
                    </div>
                    <div class="comments ">
                        <span class="reply-arrow"></span>
                        <div class="reply-area clearfix">
                            <form id="subform" action="@Url.Action("PinLun", "Designer")" method="GET">
                                <input class="reply-input" name="Content" type="text">
                                <input type="hidden" id="myMoodId" name="MoodId" value="@item.ID"/>
                                <input type="hidden" id="myParentId" name="ParentId" value="0" />
                                <input type="hidden" id="myUserId" name="UserId" value="@Model.Users.ID"/>
                                <div class="clearfix">
                                    @*<a id="facepanelid523" href="javascript:void(0);" class="faceeditor pull-left icon-editor img"></a>*@
                                    <a class="submit-reply pull-right submit-my" href="#" lang="523">评论</a>
                                </div>
                            </form>
                        </div>
                        <!-- 回复列表-start -->
                        @if (item.MoodReplys.Count > 0)
                        {
                            foreach (var item2 in item.MoodReplys.OrderBy(t => t.CreateTime))
                            {
                            <div class="a-comment clearfix">
                                <div class="pull-left mini-avater">
                                    <a href="/Designer/DesignerMain?id=@item2.User.ID">
                                        <img src="@item2.User.HeadPortrait" height="30" width="30">
                                    </a>
                                </div>

                                <div class="other-say">
                                    <a href="/Designer/DesignerMain?id=@item2.User.ID">@item2.User.NickName
                                        <span class="level-img">
                                            <img class="zhuguan" src="/images/competent.gif" alt="管理员" title="管理员" align="absmiddle"></span></a>
                                    ：@if (item2.ParentId != 0)
                                     {
                                         var li = item.MoodReplys.Where(t => t.UserId == item2.ParentId).FirstOrDefault();

                                        @Html.Raw("回复<a href='#'>" + li.User.NickName +"</a>:")
                                     }@item2.Content
                                    &nbsp;&nbsp;<a class="mydiplay" href="javascritp:void(0)">回复</a>
                                    <div class="mydivs" style="width: 210px; display: none">
                                        <br />
                                        <form action="@Url.Action("HueiFu", "Designer")" method="GET" id="subfrom2">
                                            <input name="Content" type="text" class="mycontent" /><br />
                                            <input type="hidden" id="myMoodId2"  name="MoodId" value="@item.ID"/>
                                            <input type="hidden" id="myParentId2" name="ParentId" value="@item2.User.ID" />
                                            <input type="hidden" id="myUserId2" name="UserId" value="@Model.Users.ID"/>
                                            <a class="submit-reply pull-right submit-my2" href="#" lang="523">发表</a><br />
                                        </form>
                                    </div>
                                    <span class="light">(@((DateTime.Now - item2.CreateTime).Hours > 0 ? (DateTime.Now - item2.CreateTime).Hours + "小时" : null)@((DateTime.Now - item2.CreateTime).Minutes)分钟前)</span>
                                </div>
                            </div>
                            }
                        }

                        <!-- 回复列表-end -->
                    </div>
                </div>
            </div>
        }



        <!-- 话题-end -->
    </div>
    <div class="topic-more text-center">
        <a class="btn btn-large show_more_msg mt1 mb1" href="/Designer/Index?page=@ViewBag.Page" >更多新鲜事...</a>
        <input id="hid_cur_page" value="2" type="hidden">
    </div>
</div>
<!-- 中栏交流-end -->
<div class="right-column">
    <div class="myinfo clearfix">
        <div class="avatar pull-left">
            <a href="#">
                <img src="@Model.Users.HeadPortrait" title="还没有上传个人头像？马上去‘个人信息’上传个性头像吧！" height="80" width="80">

                <img style="_display: none; *display: none;" src="/images/avater_bg.gif">
            </a>
        </div>
        <div class="aboutme pull-left">
            <ul>
                <li>
                    <a href="#" class="name">@Model.Users.NickName</a>
                </li>
                <li>
                    <!-- <img src="../images/mini/level_3.gif" class="img2" alt="资深设计师" align="absmiddle">&nbsp;资深设计师 -->
                    @*<img src="/images/level_0.gif" class="img2" alt="实习设计师" title="实习设计师" align="absmiddle">
                    实习设计师*@
                </li>
            </ul>
        </div>
    </div>
    <ul class="user_atten clearfix">
        <li><strong>@Model.tenders</strong><span>投标</span></li>
        <li><strong>@Model.Finalist</strong><span>入围</span></li>
        <li><strong>@Model.WinTheBidding</strong><span>中标</span></li>
    </ul>
    <div class="mymoney">
        <span class="tit">佣金总额：</span><span class="con">@(Model.MoneyCount)元</span><br>
        <span class="tit">佣金余额：</span><span class="con">@(Model.Money)元</span>
    </div>
    <div class="sub-sider">
        <div class="tit"><span>网站新闻</span></div>
        <ul class="normal-li">
            @foreach (var item in Model.Newses)
            {
                <li>
                    <a href="javascript: newsmydialog('@item.Content')" title="@item.Title"  style="text-decoration:none;">@item.Title</a>
                </li>
            }
        </ul>
        <!-- 网站新闻 隐藏弹层 Start -->
        <div class="hidden">
        </div>
        <div class="hidden">
            <div id="news2" style="font-size: 16px; width: 700px; height: 240px;">
                <p>你知道吗，相同的设计师帐号可以同时登录我们【标志123】与【精英客】两个网站？</p>
                <h3 style="margin: 15px 0 5px 0;">关于标志123</h3>
                <p>我们专业的LOGO设计平台。 每个设计项目我们都设立了丰厚的中标奖金与初稿佣金，欢迎大家参与。  前往<a href="#">任务大厅&gt;&gt;</a></p>
                <h3 style="margin: 15px 0 5px 0;">关于标志123</h3>
                <p>设计师作品展示与接单平台。感兴趣的雇主可以直接与QQ咨询设计师。 达成协议后雇主将对设计师发起1对1雇佣请求，并托管任务奖金。项目完成后设计师将得到90%的任务奖金。  前往<a href="#">标志123设计师页&gt;&gt;</a></p>
            </div>
        </div>
        <div class="hidden">
        </div>
        <!-- 网站新闻 隐藏弹层 End -->
    </div>
    <div class="sub-sider">
        <div class="tit"><span>设计师须知</span></div>
        <ul class="normal-li">
            @foreach (var item in Model.Helps)
            {
                <li>
                    <a href="javascript:Helpsmydialog('@item.Content')" >@item.Title</a>
                </li>
            }
        </ul>
    </div>
    <div class="sub-sider">
        <div class="tit"><span>收入排行 <b class="font12 light">[近30天]</b></span></div>
        <ul class="normal-li">
            @foreach (var item in Model.Myuserses)
            {
                <li class="clearfix">
                    <a class="pull-left" href="#">@item.name</a>
                    <span class="red pull-right">@(item.amount)元</span>
                </li>
            }

        </ul>
    </div>
    <div class="sub-sider">
        <div class="tit"><span>网站动态</span></div>
        <ul class="normal-li dynamic newsul">
            @foreach (var item in Model.Trends)
            {
                <li class="clearfix">
                    <span class="light pull-right">@((DateTime.Now - item.CreateTime).Minutes


)分钟前</span>
                    <div>
                        <strong>@item.Designer.NickName</strong>@if (item.Status == 3)
                                                                {
                            @Html.Raw("中标了")
                                                                }
                                                                else
                                                                {
                            @Html.Raw("入围了")
                                                                }
                        <p class="clearfix">
                            <a class="event-a pull-left" href="/Designer/DesignerMain?id=@item.Designer.ID">访问Ta的主页</a>
                        </p>
                    </div>
                </li>
            }
        </ul>
        <div class="topic-more text-center">
            <a class="btn show_news_msg mb1" href="/Designer/Index?page=@ViewBag.Page" >更多动态...</a>
            <input id="hid_news_page" value="2" type="hidden">
        </div>
    </div>
</div>
<!-- 右栏个人信息-end -->



